package vn.cuhanh.dialog;

import vn.cuhanh.BaseActivity;
import vn.cuhanh.MainActivity;
import vn.cuhanh.R;
import vn.cuhanh.fragment.MenuFragment;
import android.os.Bundle;
import android.widget.TextView;

public class ViewZingMeInfoDialog extends BaseActivity {
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.view_zing_me_info);
		setBehindContentView(R.layout.menu_frame);MenuFragment menuFragment = MenuFragment.getInstance(this);
		getSupportFragmentManager().beginTransaction().replace(R.id.menu_frame, menuFragment).commit();
		
		if(MainActivity.userAccount == null) {
			onBackPressed();
			return;
		}
	}	
	
	@Override
	public void onResume() {
		super.onResume();
		initTextViews();
		BaseActivity.updateDndScore(findViewById(R.id.footer));
	}
	
	/**
	 * Fill Zing Me info to TextViews
	 */
	public void initTextViews() {
		TextView txtZingMeName = (TextView)findViewById(R.id.zing_me_name);
		txtZingMeName.setText(MainActivity.userAccount.getZingMeName());
		if(MainActivity.userAccount != null ) {
			TextView phoneNo = (TextView)findViewById(R.id.phone_no);
			phoneNo.setText(MainActivity.userAccount.getPhoneNo());
		}
	}
	
	@Override
	public boolean isShowBackBtn() {
		return true;
	}
}
